import request from '@/utils/request'

// 查询计划分批列表
export function listBatch(query) {
  return request({
    url: '/sale/batch/list',
    method: 'get',
    params: query
  })
}

// 查询计划分批详细
export function getBatch(serialId) {
  return request({
    url: '/sale/batch/' + serialId,
    method: 'get'
  })
}

// 查询计划分批详细
export function getBatchDetails(planId) {
  return request({
    url: '/sale/batch/d/' + planId,
    method: 'get'
  })
}

// 查询计划分批详细
export function getBatchDetailsWithSerialId(batchId) {
  return request({
    url: '/sale/batchDetails/' + batchId,
    method: 'get'
  })
}

// 新增计划分批
export function addBatch(data) {
  return request({
    url: '/sale/batch',
    method: 'post',
    data: data
  })
}

// 修改计划分批
export function updateBatch(data) {
  return request({
    url: '/sale/batch',
    method: 'put',
    data: data
  })
}

// 删除计划分批
export function delBatch(serialId) {
  return request({
    url: '/sale/batch/' + serialId,
    method: 'delete'
  })
}
// 删除计划分批
export function processBatch(serialId) {
  return request({
    url: '/sale/batch/process',
    method: 'put',
    data:serialId
  })
}

